#include <iostream>
#include <deque>
#include <algorithm>
using namespace std;
#define juege_num 10

class Judge {
	private:
		std::deque<int> ratings;
	public:
		Judge() {
			ratings.resize(juege_num);
		}

		void add_ratings(int index,int rating) {
			ratings[index] = rating;
		}
		double getAverage_ratings() {
			int sum = 0;
			sort(ratings.begin(), ratings.end());
			ratings.pop_back();
			ratings.pop_front();
			for(int i = 0; i < juege_num-2; i++){
				sum += ratings[i];
			}

			return (double)sum/(juege_num-2.0);
		}

		void clear_ratings() {
			ratings.clear();
			ratings.resize(juege_num,0);
		}
		
};